<?php
require_once dirname(__FILE__).'/include.php';
Master::loadCoreClass("AdminControl");
$Admin = new AdminControl();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=Config::$siteName ?></title>    
<?php
require_once dirname(__FILE__).'/heard.php';
?> 	
</head>
<body>
<?php
$Admin = new AdminControl();
if (Get::getByKey('action')=='save')
{	
	$Admin ->createAdminGroup();
	Header("Location:adminsgroupList.php");
}
$listadminsgroup = $Admin->listAdminsGroup(array());
?>
<div id="main-content">		
				<div class="content-box">
				<div class="content-box-header">					
					<h3>当前位置：<?=Config::$siteName ?>管理系统 &gt; 权限组添加</h3>					
					<ul class="content-box-tabs">
						<li><a href="#tab1" class="default-tab">权限组添加</a></li>
					</ul>					
					<div class="clear"></div>					
				</div>
				<div class="content-box-content">					
					<div class="tab-content default-tab" id="tab1"> 
						<form action="?action=save" method="post" name="admins" id = "admins">							
							<fieldset>								
								<p>	
									<label>组名</label>
									<input class="text-input small-input" type="text" id="name" name="name" />
									<label>父ID</label>
									<input class="text-input small-input" type="text" id="pid" name="pid" value="0" /> 
									<label>状态</label>
									<select class="text-input small-input" name="status" id = "status">
									<option value="1" >有效</option>
									<option value="0" >无效</option>
									</select>									
									<label>备注</label>
									<input class="text-input small-input" type="text" id="remark" name="remark" /> 
									<label>英文名</label>
									<input class="text-input small-input" type="text" id="ename" name="ename" /> 
<?php  
$admingroupnote = $Admin->execute('select remark from admins_node group by remark');
?>			
									<table width="600" border="0" cellpadding="0" cellspacing="0">
									<?php
									$i=1;
									foreach($admingroupnote as $key){
									?>
										<tr><td colspan="4" height="25"><?=$key['remark']?></td></tr>
										<tr height="20">
										<?php
										$a = 1;
										$groupnote = $Admin->execute("select * from admins_node where remark='".$key['remark']."'");
										foreach($groupnote as $k){
											if ($a >=5 && $a % 5 == 0 )
											{
												echo '</tr><tr height="25">';
											}
										?>	
											<td width="25%"><input type="checkbox" name="<?=$k['names']?>" value="<?=$k['id']?>" /><?=$k['title']?></td>
											<?php 
											$a++;
											}?>
										</tr>
										<?php
											$i++;
											}
										?>
									</table>																			
								</p>
								<div class="clear"></div>
								<input  type="submit"  value="提交"/> <input type="reset"  value="重置" />	
							</fieldset>
						</form>
					</div>
					
				</div> 
</div> 
</div>

</body>  
</html>
